﻿//    Copyright 2014 LuoZhihui
//    Licensed under the Apache License, Version 2.0 (the "License");
//    you may not use this file except in compliance with the License.
//    You may obtain a copy of the License at
//      http://www.apache.org/licenses/LICENSE-2.0
//    Unless required by applicable law or agreed to in writing, software
//    distributed under the License is distributed on an "AS IS" BASIS,
//    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//    See the License for the specific language governing permissions and
//    limitations under the License.

#region  导入名称空间

using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using LotteryEngine.Infrastructure.Domain;

#endregion

namespace LotteryEngine.Model
{
	/// <summary>
	///     奖项
	/// </summary>
	public class Prize : EntityBase<long>, IAggregateRoot
	{
		public Prize()
		{
			Configs = new HashSet<Config>();
			Records = new HashSet<Record>();
		}


		/// <summary>
		///     奖项名称
		/// </summary>
		[StringLength(100)]
		[Required]
		public virtual string PrizeName { get; set; }


		/// <summary>
		///     奖项代码
		/// </summary>
		[StringLength(100)]
		[Required]
		public virtual string PrizeCode { get; set; }


		/// <summary>
		///     奖券面值
		/// </summary>
		public virtual double PrizePar { get; set; }


		/// <summary>
		///     奖品总量
		/// </summary>
		[Required]
		public virtual long TotalCount { get; set; }


		/// <summary>
		///     剩余数量
		/// </summary>
		[Required]
		public virtual long PrizeBlance { get; set; }


		/// <summary>
		///     是否启用此奖项
		/// </summary>
		[Required]
		public virtual bool IsActived { get; set; }


		/// <summary>
		///     奖项配置列表
		/// </summary>
		public virtual ISet<Config> Configs { get; set; }


		/// <summary>
		///     玩家抽奖记录
		/// </summary>
		public virtual ISet<Record> Records { get; set; }


		protected override void Validate()
		{
			throw new NotImplementedException();
		}
	}
}